<template>
  <div class="login-account">
    <el-form status-icon label-width="65px" :rules="rules" :model="account">
      <el-form-item label="账号" prop="phone">
        <el-input v-model="account.phone"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input
          type="password"
          v-model="account.password"
          show-password
        ></el-input>
      </el-form-item>

      <el-form-item label="验证码" prop="code">
        <div class="get-code">
          <el-input v-model="account.code"></el-input>
          <el-button type="primary" class="getcode-btn">获取验证码</el-button>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from 'vue'

import { rules } from '../config/account-config'

export default defineComponent({
  setup() {
    const account = reactive({
      name: '',
      password: '',
      code: ''
    })

    return {
      account,
      rules
    }
  }
})
</script>

<style scoped>
.get-code {
  display: flex;
}
.getcode-btn {
  margin-left: 8px;
}
</style>
